//
//  ScoreCell.m
//  edu
//
//  Created by baobaodp on 13-8-23.
//  Copyright (c) 2013年 baobaodp. All rights reserved.
//

#import "ScoreCell.h"

@implementation ScoreCell
@synthesize imgView;
@synthesize monthName;
@synthesize testDate;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void) setData:(Record *) record index: (int) rowIndex imgName:(NSString *) imgName
{
    self.testName.text = [record getFieldValueByName:@"TP_Name"];
    
    UIImage *img=[UIImage imageNamed:imgName];
    self.imgView.image =img;
    
    NSString *date =[record getFieldValueByName:@"TP_date"];
    
    self.testDate.text =[NSString stringWithFormat:@"%@/%@/%@",
                         [date substringWithRange:NSMakeRange(0,4)] ,
                         [date substringWithRange:NSMakeRange(4,2)],
                         [date substringWithRange:NSMakeRange(6,2)]];
    
    self.monthName.text =[NSString stringWithFormat:@"%d月",
                          [[date substringWithRange:NSMakeRange(4,2)] intValue]];
    
}

@end
